
// If invoice is successfully paid then reload invoice preview with success message.
<% if @result[:status].to_s == "SUCCESS" %>
    <% flash[:notice] = @result[:message] %>
    window.location = "/invoices/preview/?inv_id=<%= params[:invoice_id] %>";
<% else %>
    jQuery("#cc_popup_error.alert.alert-error").show().find("span").html("<%= @result[:message]%>");
    jQuery("#cc_popup input[type=submit]").removeAttr("disabled");
<% end %>
